package com.gqz.equip.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * 库存任务装备实体
 *
 * @author gqz20
 * @date 2023/02/18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_STOCK_TASK_EQUIP")
public class EnStockTaskEquipEntity implements Serializable {

    /**
     * 主键
     */
    @TableId
    private String id;

    /**
     * 任务编号
     */
    @TableField(value = "TASK_NO")
    private String taskNo;

    /**
     * 设备编码
     */
    @TableField(value = "EQUIP_NO")
    private String equipNo;

    /**
     * 是否删除
     */
    @TableField(value = "IS_DEL")
    private String isDel;

    /**
     * 库存数
     */
    @TableField(value = "STOCK_NUM")
    private String stockNum;

    /**
     * 实际数
     */
    @TableField(value = "ACTUAL_NUM")
    private String actualNum;

    /**
     * 设备名称
     */
    @TableField(value = "EQUIP_NAME")
    private String equipName;

    /**
     * 设备类型编码
     */
    @TableField(value = "EQUIP_TYPE_NO")
    private String equipTypeNo;

    /**
     * 设备类型
     */
    @TableField(value = "EQUIP_TYPE_NAME")
    private String equipTypeName;

    /**
     * 盘点方式编码(1扫码2手动)
     */
    @TableField(value = "STOCK_METHOD_NO")
    private String stockMethodNo;

    /**
     * 盘点方式
     */
    @TableField(value = "STOCK_METHOD_NAME")
    private String stockMethodName;

    /**
     * 出厂编号
     */
    @TableField(value = "FACTORY_NO")
    private String factoryNo;

    /**
     * 是否已检测
     */
    @TableField(value = "IS_DETECT")
    private String isDetect;

    /**
     * 工单运行状态名称
     */
    @TableField(value = "RUN_STATUS_NAME")
    private String runStatusName;

    /**
     * 详情描述信息
     */
    @TableField(value = "DETAILED_DESCRIPTION")
    private String detailedDescription;

    /**
     * 创建人
     */
    @TableField(value = "CREATOR")
    private String creator;

    /**
     * 创建时间
     */
    @TableField(value = "CREAT_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "creatTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date creatTime;

    /**
     * 计量方式编码
     */
    @TableField(value = "METER_TYPE_NO")
    private String meterTypeNo;

    /**
     * 计量方式名称
     */
    @TableField(value = "METER_TYPE_NAME")
    private String meterTypeName;

    /**
     * 规格
     */
    @TableField(value = "EQUIP_SPECIFICATION")
    private String equipSpecification;

    /**
     * 型号
     */
    @TableField(value = "MODEL")
    private String model;

    /**
     * pt
     */
    @TableField(value = "PT")
    private String pt;

    /**
     * ct
     */
    @TableField(value = "CT")
    private String ct;

    /**
     * 是否检测 0否1是
     */
    @TableField(value = "IF_TEST")
    private String ifTest;

    /**
     * 厂家名称
     */
    @TableField(value = "FACTORY_NAME")
    private String factoryName;

    /**
     * 运行状态
     */
    @TableField(value = "RUN_STATE")
    private String runState;


    /**
     * start����Ǳ���Ҫ�Ķ�̬��������start   start
     */
    private static Map<String, SFunction<EnStockTaskEquipEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("id", EnStockTaskEquipEntity::getId);
        map.put("taskNo", EnStockTaskEquipEntity::getTaskNo);
        map.put("equipNo", EnStockTaskEquipEntity::getEquipNo);
        map.put("isDel", EnStockTaskEquipEntity::getIsDel);
        map.put("stockNum", EnStockTaskEquipEntity::getStockNum);
        map.put("actualNum", EnStockTaskEquipEntity::getActualNum);
        map.put("equipName", EnStockTaskEquipEntity::getEquipName);
        map.put("equipTypeNo", EnStockTaskEquipEntity::getEquipTypeNo);
        map.put("equipTypeName", EnStockTaskEquipEntity::getEquipTypeName);
        map.put("stockMethodNo", EnStockTaskEquipEntity::getStockMethodNo);
        map.put("stockMethodName", EnStockTaskEquipEntity::getStockMethodName);
        map.put("factoryNo", EnStockTaskEquipEntity::getFactoryNo);
        map.put("isDetect", EnStockTaskEquipEntity::getIsDetect);
        map.put("runStatusName", EnStockTaskEquipEntity::getRunStatusName);
        map.put("detailedDescription", EnStockTaskEquipEntity::getDetailedDescription);
        map.put("creator", EnStockTaskEquipEntity::getCreator);
        map.put("creatTime", EnStockTaskEquipEntity::getCreatTime);
        map.put("meterTypeNo", EnStockTaskEquipEntity::getMeterTypeNo);
        map.put("meterTypeName", EnStockTaskEquipEntity::getMeterTypeName);
        map.put("equipSpecification", EnStockTaskEquipEntity::getEquipSpecification);
        map.put("model", EnStockTaskEquipEntity::getModel);
        map.put("pt", EnStockTaskEquipEntity::getPt);
        map.put("ct", EnStockTaskEquipEntity::getCt);
        map.put("ifTest", EnStockTaskEquipEntity::getIfTest);
        map.put("factoryName", EnStockTaskEquipEntity::getFactoryName);
        map.put("runState", EnStockTaskEquipEntity::getRunState);

    }

    public static SFunction<EnStockTaskEquipEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }
    /** end����Ǳ���Ҫ�Ķ�̬��������end   end */


}
